Skip to content

Adding UMD support to help allow Typescript#203

Closed
tonicblue wants to merge 6 commits intostrongloop:masterfrom
tonicblue:umd-support
Closed

Adding UMD support to help allow Typescript#203
tonicblue wants to merge 6 commits intostrongloop:masterfrom
tonicblue:umd-support

Conversation

@tonicblue
Copy link
Copy Markdown

@tonicblue tonicblue commented Aug 9, 2016

Relating to issue 202

Have included tests and added 2 lines to .eslintignore to ignore generated code.

Signed-off-by: Matthew Wilkes matthew.wilkes@scvo.org.uk

@slnode
Copy link
Copy Markdown

slnode commented Aug 9, 2016

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@slnode
Copy link
Copy Markdown

slnode commented Aug 9, 2016

Can one of the admins verify this patch?

1 similar comment
@slnode
Copy link
Copy Markdown

slnode commented Aug 9, 2016

Can one of the admins verify this patch?

Comment thread lib/executor.js Outdated
debug('Customizing model %s', name);
code(model);
// If code is a default UMD module use it
} else if (code.hasOwnProperty('default')) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this check more robust by also checking for the presence of code. __esModule?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes perfect sense. Just committed an update.

Cheers

@bajtos
Copy link
Copy Markdown
Member

bajtos commented Sep 5, 2016

Hi @tonicblue, sorry for the delay. The patch LGTM. However, I am little bit worried about upgrading the test fixture files when TypeScript and/or ES6 changes how the code is generated and modules exported.

I am proposing to add the original ts files you used to produce test/fixtures/simple-app/boot/umd.js and test/fixtures/umd-app/models/customer.js, and leave a comment in each of those TS files explaining how to convert them to JS files.

Thoughts?

@bajtos
Copy link
Copy Markdown
Member

bajtos commented Nov 22, 2016

@davidcheung could you please take this patch over from me, since you are most familiar with the new refactored codebase now?

@slnode
Copy link
Copy Markdown

slnode commented Nov 22, 2016

Can one of the admins verify this patch?

@bajtos
Copy link
Copy Markdown
Member

bajtos commented Nov 22, 2016

@raymondfeng @ritch this patch is enabling LoopBack users to write their apps in TypeScript. We may want to prioritize this feature in our backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants